local hx__moren = fk.CreateSkill {
  name = "hx__moren",
}

hx__moren:addEffect(fk.Damaged, {
  anim_type = "offensive",
  can_trigger = function (self, event, target, player, data)
    return player:hasSkill(hx__moren.name) and data.from == player and data.damage
  end,
  on_cost = function (self, event, target, player, data)
    local room = player.room
    if room:askToSkillInvoke(player, {
      skill_name = hx__moren.name,
      prompt = "是否令其失去所有体力？",
    }) then
      event:setCostData(self, {tos = {target}})
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local num = target.hp
    room:loseHp(target, num, hx__moren.name)
    if target.dead then
      player:drawCards(num, hx__moren.name)
      room:invalidateSkill(player, "hx__moling", "-round")
      room:invalidateSkill(player, hx__moren.name, "-round")
    end
  end,
})



return hx__moren